package buisness_service;

import java.util.ArrayList;
import java.util.List;

public class PosteDepense extends Categorie {

	private int id_Poste_Depense;
	private static int nbPosteDepense = 0;
	private List<Depense> depenses;

	public PosteDepense(String nom) {
		super(nom);
		nbPosteDepense++;
		this.setId_Poste_Depense(nbPosteDepense);
		depenses = new ArrayList<Depense>();

		Rapport.postesDpenses.add(this);

	}

	public PosteDepense(String nom1, List<Depense> depenses) {
		super(nom1);
		nbPosteDepense++;
		this.setId_Poste_Depense(nbPosteDepense);

		this.setDepenses(depenses);
		for (int i = 0; i < this.depenses.size(); i++)
			this.depenses.get(i).setPosteDepense(this);
		Rapport.postesDpenses.add(this);

	}

	public List<Depense> getDepenses() {
		return depenses;
	}

	public void setDepenses(List<Depense> depenses) {
		this.depenses = depenses;
	}

	public void addDepense(Depense depense) {
		this.depenses.add(depense);
	}

	public void removeDepense(int i) {
		this.depenses.remove(i);
	}

	public int getnbPosteDepense() {
		return nbPosteDepense;
	}

	public int getId_Poste_Depens() {
		return id_Poste_Depense;
	}

	public void setId_Poste_Depense(int id_Depense) {
		this.id_Poste_Depense = id_Depense;
	}

}
